/* jCountdown 1.4.2 jQuery Plugin Copyright 2012 Tom Ellis http://www.webmuse.co.uk | MIT Licensed (license.txt) */ (function(a){a.fn.countdown=function(b){var c={date:null,updateTime:1e3,htmlTemplate:" ",minus:!1,onChange:null,onComplete:null,onResume:null,onPause:null,leadingZero:!1,offset:null,servertime:null,hoursOnly:!1,minsOnly:!1,secsOnly:!1,hours:!1,yearsAndMonths:!1,direction:"down"},d=[].slice,e=window.clearInterval,f=Math.floor,g=Math.ceil,h=36e5,i=864e5,j=/(%y|%m|%d|%h|%i|%s)/g,k=/%y/,l=/%m/,m=/%d/,n=/%h/,o=/%i/,p=/%s/,q=function(a,b){var c,d,e,f,g=new Date;return a===null?d=g.getTime()-b:(c=a*h,f=g.getTime()- -g.getTimezoneOffset()/60*h+c,d=g.setTime(f)),new Date(d)},r=function(){var a=this,b,c,d,g,h,i,r,s,t,u,v,w,x,y="",z,A={years:0,months:0,days:0,hours:0,minutes:0,seconds:0},B=function(a){var b;return b=f(z/a),z-=b*a,b},C=a.data("jcdData");if(!C)return!1;b=C.htmlTemplate,C.offset===null&&C.servertime===null?c=new Date:C.offset!==null?c=q(C.offset):c=q(null,C.difference),c.setMilliseconds(0),d=new Date(C.date),d.setMilliseconds(0),g=C.direction==="down"?d.getTime()-c.getTime():c.getTime()-d.getTime(),z=Math.round(g/1e3),A.days=B(86400),A.hours=B(3600),A.minutes=B(60),A.seconds=B(1),C.yearsAndMonths&&(z+=A.days*86400,A.years=B(31556926),A.months=B(2629743.83),A.days=B(86400)),h=A.years,i=A.months,s=A.days,u=A.hours,v=A.minutes,x=A.seconds,C.hoursOnly&&(u+=s*24,s=0),C.minsOnly&&(v+=u*60+s*24*60,s=u=0),C.secsOnly&&(x+=v*60,s=u=v=0),C.yearsLeft=h,C.monthsLeft=i,C.daysLeft=s,C.hrsLeft=u,C.minsLeft=v,C.secLeft=x,x===60&&(x=0),C.leadingZero&&(s<10&&!C.hoursOnly&&(s="0"+s),h<10&&(h="0"+h),i<10&&(i="0"+i),u<10&&(u="0"+u),v<10&&(v="0"+v),x<10&&(x="0"+x)),C.direction==="down"&&(c 0) { txt = txt[0]; } } $('#'+id).html('
'+txt.days+'
'+txt.hours+'
'+txt.minutes+'
'+txt.seconds+'
'); var clock = document.getElementById(id); var daysSpan = clock.querySelector('.days'); var hoursSpan = clock.querySelector('.hours'); var minutesSpan = clock.querySelector('.minutes'); var secondsSpan = clock.querySelector('.seconds'); function getTimeRemaining(endtime) { var t = endtime; var seconds = Math.floor((t / 1000) % 60); var minutes = Math.floor((t / 1000 / 60) % 60); var hours = Math.floor((t / (1000 * 60 * 60)) % 24); var days = Math.floor(t / (1000 * 60 * 60 * 24)); return { 'total': t, 'days': days, 'hours': hours, 'minutes': minutes, 'seconds': seconds }; } function updateClock(first) { if(!first){ endtime -= 1000; } var t = getTimeRemaining(endtime); daysSpan.innerHTML = t.days; hoursSpan.innerHTML = ('0' + t.hours).slice(-2); minutesSpan.innerHTML = ('0' + t.minutes).slice(-2); secondsSpan.innerHTML = ('0' + t.seconds).slice(-2); if (t.total <= 0) { clearInterval(timeinterval); } } updateClock(true); var timeinterval = setInterval(updateClock, 1000); } /**************************************************************************************/ /* FONT INC DEC */ /**************************************************************************************/ (function ($) { $.fn.extend({ fontIncDec: function (options) { var action = options.action; var actionEle = this; this.on("click", function () { var eleParent = actionEle.parent(); //var currentTimes = actionEle.data('times') ? : 0; var selectors = (eleParent.data("fontselectors") ? eleParent.data("fontselectors") : "div, p, h1, h2, h3, h4, h5, button, li, a, span, strong, select, input, label, legend, td, b, div.panel-body"); var actionVal = (eleParent.data("val") ? eleParent.data("val") : 2); // Increase and decrease value var actionMaxTimes = eleParent.data("maxtimes") ? eleParent.data("maxtimes") : 2; // Number of times for increase and decrease var ignoreSelectors = eleParent.data("fontignore"); if (ignoreSelectors == "") { ignoreSelectors += ".keywords_input_top" } else { ignoreSelectors += ", .keywords_input_top" } /*if(currentTimes >= actionMaxTimes) { return; }*/ $(selectors).not(ignoreSelectors).each(function () { var ele = $(this); if (ele.children().length < 3 || ele.prop("tagName") == "SELECT") { var thisFont = ele.css("font-size").split("px"); if (action == "inc") { thisFont = parseInt(thisFont[0]) + actionVal; } else { thisFont = parseInt(thisFont[0]) - actionVal; } ele.css("fontSize", thisFont + "px"); } }); }); } }); })(jQuery);